feat: broadcast user prompts to frontend observers#19
Conversation
Fan out user-originated NDJSON messages to all connected frontend WebSocket clients so observer UIs can render user prompts that are not echoed back by the Claude SDK.
Summary of ChangesHello @axeldelafosse, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the real-time communication within the system by enabling the broadcasting of user prompts and frontend-originated messages to all connected frontend observers. This change allows for a more comprehensive and consistent view of the interaction flow across multiple UIs, ensuring that all user inputs are visible, even when not explicitly echoed by the Claude SDK. Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces functionality to broadcast user-originated messages to all connected frontend clients, enhancing observer UIs. However, the current implementation has a critical security vulnerability: the WebSocket server lacks security controls, potentially leading to information leakage of sensitive prompts and session data to unauthorized users due to its default binding to all interfaces (0.0.0.0) and absence of authentication or origin validation. It is recommended to restrict the server to localhost and add authentication. Additionally, there's a minor code duplication issue that could be refactored for better maintainability.
Summary
handleFrontendMessagesendUserMessagepayloads to frontends so observer UIs can render user prompts that aren't echoed back by the Claude SDKTest plan